//
//  SettingVC.m
//  renyikan
//
//  Created by Steven on 2019/7/16.
//  Copyright © 2019 Steven. All rights reserved.
//

#import "SettingVC.h"

#import <StoreKit/StoreKit.h>

@implementation SettingVC


- (void)viewDidLoad{
    
    [super viewDidLoad];
    self.tableView.tableFooterView = [UIView new];
    
    
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section == 0 && indexPath.row == 2) {
        //评价
        if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.3) {
            [SKStoreReviewController requestReview];
        } else {
            NSURL *url  = [NSURL URLWithString:@"https://itunes.apple.com/cn/app/inotes/id1472468722?l=zh&ls=1&mt=8&action=write-review"];
            [[UIApplication sharedApplication] openURL:url];
        }

    }else if (indexPath.section == 1){
        //清楚缓存
        [[SDImageCache sharedImageCache] clearMemory];
        [[SDImageCache sharedImageCache] clearDiskOnCompletion:^{
            [Toast.makeText(@"清理完成！") showOnDismiss:nil];
            
        }];
        
    }
    
}


@end
